import 'package:trollee/app/core/core.dart';
import 'package:trollee/app/routes/app_pages.dart';

class SplashPage extends StatefulWidget {
  const SplashPage({Key? key}) : super(key: key);

  @override
  State<SplashPage> createState() => _SplashPageState();
}

class _SplashPageState extends State<SplashPage> {
  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    Future.delayed(
      const Duration(milliseconds: 100),
      () {
        if (UserManager.isLoggedIn) {
          Get.offAllNamed(AppRoutes.home);
        } else {
          UserManager.removeUserInfo();
          Get.offAllNamed(AppRoutes.authLogin);
        }
      },
    );
  }

  @override
  Widget build(BuildContext context) {
    return const Scaffold();
  }
}
